<?php
/**
 * ============================================================================
 * Copyright (c) 2015-2018 贵州大师兄信息技术有限公司 All rights reserved.
 * siteַ: http://www.dsxcms.com
 * ============================================================================
 * @author:     David Song<songdewei@163.com>
 * @version:    v1.0.0
 * ---------------------------------------------
 * Date: 2018/6/12
 * Time: 下午3:20
 */

Route::group(['namespace' => 'SellerApp'], function () {
    Route::get('/version', function () {
        $userAgent = 'time:'.time().','.$_SERVER['HTTP_USER_AGENT'];
        if(strpos($userAgent, 'Android') || strpos($userAgent, 'okhttp')){
            return ajaxReturn(['version'=>2.4, 'userAgent'=>$userAgent]);
        } else {
            return ajaxReturn(['version'=>2.4, 'userAgent'=>$userAgent]);
        }
    });

    Route::get('/checklogin', 'IndexController@checklogin');
    Route::any('/jpush', 'JPushController@index');

    Route::any('/account/signin', 'AccountController@signin');
    Route::any('/account/signup', 'AccountController@signup');

    Route::get('/district/get', 'DistrictController@get');
    Route::get('/district/batchget', 'DistrictController@batchget');

    Route::get('/token', 'TokenController@index');
    Route::get('/token/check', 'TokenController@check');

    //item
    Route::any('/item/get_item', 'ItemController@getItem');
    Route::any('/item/batchget', 'ItemController@batchget');
    Route::any('/item/save', 'ItemController@save');
    Route::any('/item/delete', 'ItemController@delete');
    Route::any('/item/togglesale', 'ItemController@togglesale');
    Route::any('/item/get_my_items', 'ItemController@batchgetMyItems');
    Route::any('/item/get_catlog', 'ItemController@get_catlog');
    Route::any('/item/batchget_catlog', 'ItemController@batchgetCatlog');

    //post
    Route::any('/post/batchget_item', 'PostController@batchgetItem');
    Route::any('/post/batchget_catlog', 'PostController@batchgetCatlog');

    //order
    Route::any('/order/get_sold_items', 'OrderController@getSoldItems');
    Route::any('/order/get_order', 'OrderController@getOrder');
    Route::any('/order/send', 'OrderController@send');

    //express
    Route::any('/express/batchget', 'ExpressController@batchget');
    //pages
    Route::any('/pages/get', 'PagesController@get');
    //feedback
    Route::any('/feedback/save', 'FeedbackController@save');
    //shop
    Route::any('/shop/get_shop', 'ShopController@getShop');
    Route::any('/shop/save', 'ShopController@save');

    //material
    Route::any('/material/upload_img', 'MaterialController@uploadImg');

    //user
    Route::get('/user/info', 'UserController@info');

    //security
    Route::any('/security/editpass', 'SecurityController@editpass');
    Route::any('/security/bindmobile', 'SecurityController@bindmobile');
    Route::any('/security/bindemail', 'SecurityController@bindemail');

    //wallet
    Route::any('/wallet/get_data', 'WalletController@getData');
    Route::any('/trade/get', 'TradeController@get');
    Route::any('/trade/batchget', 'TradeController@batchget');
});
